package com.demo.core.service;

import com.demo.base.page.IPagableDTO;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.demo.base.model.FullTimeJob;
import com.demo.base.page.IPagableDTO;
import com.demo.core.dao.FullTimeJobDao;

/**
 * Created by jiandandia on 2017/4/5.
 */
@Transactional
@Service
public class FullTimeJobService {
    @Autowired
    private FullTimeJobDao fullTimeJobDao;
    public FullTimeJob newOrupdateFullTimeJob(FullTimeJob fullTimeJob) throws Exception{
        return fullTimeJobDao.newOrupdateFullTimeJob(fullTimeJob);
    }

    public FullTimeJob getFullTimeJobById(String fullTimeJob) throws Exception{
        return fullTimeJobDao.getFullTimeJobById(fullTimeJob);
    }

    public IPagableDTO<FullTimeJob> getFullTimeJobByQuery(FullTimeJob fullTimeJob, IPagableDTO pagableDTO){
        return fullTimeJobDao.getFullTimeJobByQuery(fullTimeJob, pagableDTO);
    }

    public void delteFullTimeJobById(String ids) throws Exception{
        String[] idss = StringUtils.split(ids,',');
        for (String id : idss) {
            fullTimeJobDao.delteFullTimeJobById(id);
        }
    }

    public boolean addBrowsingNumber(String noticeId){
        return fullTimeJobDao.addBrowsingNumber(noticeId);
    }

    public boolean addFollowersNumber(String noticeId){
        return fullTimeJobDao.addFollowersNumber(noticeId);
    }

    public boolean addManEnterNumber(String id){
        return fullTimeJobDao.addManEnterNumber(id);
    }

    public boolean addWoManEnterNumber(String id){
        return fullTimeJobDao.addWoManEnterNumber(id);
    }
}
